<style>
  #main {
      position: absolute;
      left: 180px;
      top: 0;
      padding: 50px 180px 0 0;
      box-sizing: border-box;
      width: 100%;
      height: 100%;
  }
  #iframe_box {
      height: 100%;
  }
  @media screen and (max-width: 760px) {
    #main {
        left: 0;
        padding: 50px 0 0 0;
    }
  }
</style>

<body class="layui-layout-body">
    <!--定义部分地址方便JS调用-->
    <div style="display: none">
        <span id="controller" data-controller="{C}"></span>
        <span id="url" data-url="{URL}"></span>
        <span id="preurl" data-preurl="{fun=url('/admin',false)}"></span>
        <span id="sitedir" data-sitedir="{SITE_DIR}"></span>
        <span id="mcode" data-mcode="{$get.mcode}"></span>
    </div>
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <ul class="menu">
                <li class="menu-ico" title="显示或隐藏侧边栏"><i class="layui-icon layui-icon-shrink-right" aria-hidden="true"></i></li>
            </ul>
            {if(![$one_area])}
            <form method="post" action="{url./admin/Index/area}" class="area-select">
                <input type="hidden" name="formcheck" value="{$formcheck}">
                <div class="layui-col-xs8">
                    <select name="acode">
                        {$area_html}
                    </select>
                </div>
                <div class="layui-col-xs4">
                    <button type="submit" class="layui-btn layui-btn-sm" onclick="submit();">切换</button>
                </div>
            </form>
            {/if}
            {php}
            $lgdomain = get_domain();
            if ($lgdomain) {
                $lgdomain = is_https()? 'https://' . get_domain() : 'http://' . get_domain();
            } else {
                $lgdomain = SITE_INDEX_DIR;
            }
            {/php}
            <ul class="layui-nav layui-layout-right">
                {if([$message_status])}
                <li class="layui-nav-item layui-hide-xs">
                  <a class="header_message" href="javascript:;" onclick="set_url('{url./admin/Message/index}')"><i class="fa fa-bell" aria-hidden="true"></i> 询盘收件箱<em style="margin-top: -2px;"></em></a>
                </li>
                {/if}
                <li class="layui-nav-item layui-hide-xs">
                {php}
                if(get_config('url_rule_type')==1){
                    if(!(get_domain()) && session('acode')!=get_default_lg()){
                        echo '<a href="/index.php/'.session('acode') . [$lang_end].'" target="_blank"><i class="fa fa-home" aria-hidden="true"></i> 网站主页</a>';
                    }else{
                        echo '<a href="/" target="_blank"><i class="fa fa-home" aria-hidden="true"></i> 网站主页</a>';
                    }
                }elseif(get_config('url_rule_type')==2){
                    if(!(get_domain()) && session('acode')!=get_default_lg()){
                        echo '<a href="/'.session('acode') . [$lang_end].'" target="_blank"><i class="fa fa-home" aria-hidden="true"></i> 网站主页</a>';
                    }else{
                        echo '<a href="/" target="_blank"><i class="fa fa-home" aria-hidden="true"></i> 网站主页</a>';
                    }
                }elseif(get_config('url_rule_type')==3){
                    if(!(get_domain()) && session('acode')!=get_default_lg()){
                        echo '<a href="/?'.session('acode') . [$lang_end].'" target="_blank"><i class="fa fa-home" aria-hidden="true"></i> 网站主页</a>';
                    }else{
                        echo '<a href="/" target="_blank"><i class="fa fa-home" aria-hidden="true"></i> 网站主页</a>';
                    }
                }else{
                    echo '<a href="/" target="_blank"><i class="fa fa-home" aria-hidden="true"></i> 网站主页</a>';
                }
                {/php}
                </li>
                <li class="layui-nav-item layui-hide-xs">
                    <!-- @mk-tip -->
                    <a href="javascript:clear_common('{url./admin/Index/clearCache}','确认要清除缓存吗?')"><i class="fa fa-trash-o" aria-hidden="true"></i> 清理缓存</a>
                </li>
                <li class="layui-nav-item layui-hide-xs">
                    <a href="javascript:;">
                        <i class="fa fa-user-circle-o" aria-hidden="true"></i> {$session.realname}
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" onclick="set_url('{url./admin/Index/ucenter}')"><i class="fa fa-address-card-o" aria-hidden="true"></i> 资料修改</a></dd>
                        <dd><a href="{url./admin/Index/loginOut}"><i class="fa fa-sign-out" aria-hidden="true"></i> 退出登录</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
        

        <div class="admin-left-nav">
            <div class="layui-logo">
                <a href="{url./admin/Index/main}" title="回到后台首页">
                    <img src="{SITE_DIR}{fun=get_config('system_logo')}" height="50">
                </a>
            </div>
            <div class="layui-side layui-bg-black">
                <div class="layui-side-scroll">
                    <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                    <ul class="layui-nav layui-nav-tree" id="nav" lay-shrink="all">
                        {foreach $menu_tree(key,value)}
                        {if(!isset($value->status) || $value->status==1)}
                        <li class="layui-nav-item nav-item {if([$primary_menu_url]==$value->url)}layui-nav-itemed{/if}">
                            <a class="" href="javascript:;"><i class="fa [value->ico]" aria-hidden="true"></i>[value->name]</a>
                            <dl class="layui-nav-child">
                                {if($value->mcode=='M130')}
                                    {foreach $menu_models(key3,value3,num3)}
                                        {if($value3->type==1)}
                                            <dd><a href="javascript:;" onclick="set_url('{url./admin/Single/index/mcode/'.$value3->mcode.'}')"><i class="fa fa-file-text-o" aria-hidden="true"></i>[value3->name]内容</a></dd>
                                        {/if}
                                        {if($value3->type==2)}
                                            <dd><a href="javascript:;" onclick="set_url('{url./admin/Content/index/mcode/'.$value3->mcode.'/old/1}')"><i class="fa fa-file-text-o" aria-hidden="true"></i>[value3->name]内容</a></dd>
                                        {/if}
                                    {/foreach}
                                {else}
                                    {foreach $value->son(key2,value2,num2)}
                                    {if(!isset($value2->status) || $value2->status==1)}
                                    <dd><a href="javascript:;" onclick="set_url('{url.'.$value2->url.'}')"><i class="fa [value2->ico]" aria-hidden="true"></i>[value2->name]</a></dd>
                                    {/if}
                                    {/foreach}
                                {/if}
                            </dl>
                        </li>
                        {/if}
                        {/foreach}
                        <li style="height:1px;background:#666" class="layui-hide-sm"></li>
                        <li class="layui-nav-item layui-hide-sm">
                            <a href="{php}if(!(get_domain()) && session('acode')!=get_default_lg()){echo '/'.session('acode') . [$lang_end];}else{echo $lgdomain . '/';}{/php}" target="_blank"><i class="fa fa-home" aria-hidden="true"></i> 网站主页</a>
                        </li>
                        <li class="layui-nav-item layui-hide-sm">
                            <a href="javascript:;" onclick="set_url('{url./admin/Index/ucenter}')"><i class="fa fa-address-card-o" aria-hidden="true"></i> 资料修改</a>
                        </li>
                        <li class="layui-nav-item layui-hide-sm">
                            <a href="javascript:clear_common('{url./admin/Index/clearCache}','确认要清除缓存吗?')"><i class="fa fa-trash-o" aria-hidden="true"></i> 清理缓存</a>
                        </li>
                        <li class="layui-nav-item layui-hide-sm">
                            <a href="{url./admin/Index/loginOut}"><i class="fa fa-sign-out" aria-hidden="true"></i> 退出登录</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>